package practice.w911;

public class ReplaceAllDemo {
    public static void main(String[] args) {
        String str = "abc123def456ghi";
        str = str.replaceAll("[0-9]+","#NUMBER#");
        System.out.println(str); //abc#NUMBER#def#NUMBER#ghi
        String regex = "(gun|sha|sb)";
        String message = "你sb,gun吧!";
        message = message.replaceAll(regex,"***");
        System.out.println(message);

//        String str = "abc123def456ghi";
//        str = str.replaceAll("[0-9]+","#NUMBER#");
//        System.out.println(str); //abc#NUMBER#def#NUMBER#ghi
//        String regex = "(gun|sha|sb)";
//        String message = "你sb,gun吧!";
//        message = message.replaceAll(regex,"***");
//        System.out.println(message);
    }
}
